package com.alibaba.algo.cooperation.usercomponent.service.user;

import com.alibaba.algo.cooperation.common.BaseResult;
import com.alibaba.algo.cooperation.usercomponent.vo.req.user.*;
import com.alibaba.algo.cooperation.usercomponent.vo.res.user.SelectResourceActionListVO;
import com.alibaba.algo.cooperation.usercomponent.vo.res.user.SelectUserDetailResponseVO;
import com.alibaba.algo.cooperation.usercomponent.vo.res.user.UserAllInfoResVo;
import com.alibaba.algo.cooperation.usercomponent.vo.res.user.UserBasicInfoVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;
import java.util.Set;

/**
 * 类SysUserService.java的实现描述：用户表 service
 *
 * @author nieganggang 2021-03-12 16:08:17
 */
@FeignClient(url="${feign.userCenterUrl:}", value = "usercenter-service", contextId = "usercenter-app")
public interface SysUserService {

    @RequestMapping(value = "/sysUser/insert", method = RequestMethod.POST)
    BaseResult insert(@RequestBody SaveUserRequestVO vo);

    @RequestMapping(value = "/sysUser/insertForSync", method = RequestMethod.POST)
    BaseResult insertForSync(@RequestBody SaveUserRequestForSyncVO vo);

    @RequestMapping(value = "/sysUser/updateForSync", method = RequestMethod.POST)
    BaseResult updateForSync(@RequestBody UpdateUserRequestForSyncVO vo);

    @RequestMapping(value = "/sysUser/deleteForSync", method = RequestMethod.POST)
    BaseResult deleteForSync(@RequestBody DeleteUserRequestForSyncVO vo);

    @RequestMapping(value = "/sysUser/delete", method = RequestMethod.POST)
    BaseResult delete(@RequestBody List<Long> vo);

    @RequestMapping(value = "/sysUser/revalidate", method = RequestMethod.POST)
    BaseResult revalidate(@RequestBody List<Long> vo);

    @RequestMapping(value = "/sysUser/update", method = RequestMethod.POST)
    BaseResult update(@RequestBody UpdateUserRequestVO vo);

    @RequestMapping(value = "/sysUser/activate", method = RequestMethod.POST)
    BaseResult activate(@RequestBody List<Long> vo);

    @RequestMapping(value = "/sysUser/freeze", method = RequestMethod.POST)
    BaseResult freeze(@RequestBody List<Long> vo);

    @RequestMapping(value = "/sysUser/resetPassWd", method = RequestMethod.POST)
    BaseResult<Boolean> resetPassWd(@RequestBody ResetUserPassWord vo);

    @RequestMapping(value = "/sysUser/selectPageByApp", method = RequestMethod.POST)
    BaseResult selectPageByApp(@RequestBody SelectUserListByAppRequestVO vo);

    @Deprecated
    @RequestMapping(value = "/sysUser/selectPage", method = RequestMethod.POST)
    BaseResult selectPage(@RequestBody SelectUserListRequestVO vo);

    @RequestMapping(value = "/sysUser/selectPageEntity", method = RequestMethod.POST)
    BaseResult selectPageEntity(@RequestBody SelectUserListRequestVO vo);

    @RequestMapping(value = "/sysUser/selectDetailByCode", method = RequestMethod.POST)
    SelectUserDetailResponseVO selectDetailByCode(@RequestBody SelectUserDetailByCodeRequestVO vo);

    @RequestMapping(value = "/sysUser/selectByUserAccount", method = RequestMethod.POST)
    UserBasicInfoVO selectByUserAccount(@RequestBody SelectUserRequestVO vo);

    @RequestMapping(value = "/sysUser/selectResourceActionListByUser", method = RequestMethod.POST)
    BaseResult<Set<SelectResourceActionListVO>> selectResourceActionListByUser(@RequestBody SelectResourceActionListByUserReqVO vo);

    @RequestMapping(value = "/sysUser/authByUser",method = RequestMethod.POST)
    BaseResult authByUser(@RequestBody AuthByUserReqVO authVO);

    @RequestMapping(value = "/sysUser/selectUserEmployeeListByEmployeeCode", method = RequestMethod.POST)
    BaseResult selectUserEmployeeListByEmployeeCode(@RequestBody SelectUserListRequestVO vo);

    @RequestMapping(value = "/sysUser/selectUserEmployeeListWithIsDeletedByEmployeeCode", method = RequestMethod.POST)
    BaseResult selectUserEmployeeListWithIsDeletedByEmployeeCode(@RequestBody SelectUserListRequestVO vo);

    //更新用户、组织、岗位关系
    @RequestMapping(value = "/sysUser/addUserPositionOrgRel", method = RequestMethod.POST)
    BaseResult addUserPositionOrgRel(@RequestBody AddPositionOrgRelRequestVO vo);


    /**
     * 用户全量信息查询
     * @param vo UserAllInfoRequestVO
     * @return UserAllInfoResVo
     */
    @GetMapping(value = "/sysUser/selectUserAllInfoByUserIdOrUserCode")
    BaseResult<UserAllInfoResVo> selectUserAllInfoByUserIdOrUserCode(@RequestBody UserAllInfoRequestVO vo);

}
